package cn.datawin.routeserver.service.impl;

import cn.datawin.bms.customer.entity.CstmCustomerEntity;
import cn.datawin.routeserver.mapper.CstmCustomerMapper;
import cn.datawin.routeserver.service.CstmCustomerService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * 下游客户
 *
 * @author datawin-sms
 * @date 2025-06-17 14:46:46
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class CstmCustomerServiceImpl extends ServiceImpl<CstmCustomerMapper, CstmCustomerEntity> implements CstmCustomerService {

    @Override
    public CstmCustomerEntity getByCstmCustomerCode(String cstmCustomerCode) {
        LambdaQueryWrapper<CstmCustomerEntity> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(CstmCustomerEntity::getCode, cstmCustomerCode);
        return baseMapper.selectOne(queryWrapper);
    }
}
